package signBean;

import java.sql.*;
import java.util.LinkedList;
import java.util.List;

public class UserManager {
    public List getUserName(String classname,String phone){
	List list= new LinkedList();
	try {
		Class.forName("com.mysql.jdbc.Driver");
		Connection con = DriverManager.getConnection("jdbc:mysql://localhost/sign?useUnicode=true&characterEncoding=UTF8","root","");
		Statement st = con.createStatement();
		String where=null;
		String dd="select * from  a_signup ";
		
		
			where = "  where 1<2 ";
		if(classname.length()>0)
			
		{  where += " and name = '"+classname+"'";}
	
		if(phone.length()>0) 
		
			
		{  where += "  and phone='" + phone + "'";}
		
	
		   dd+=where;
		ResultSet rs = st.executeQuery(dd);
		while (rs.next()){
			list.add(rs.getString("e_mail"));
			list.add(rs.getString("userview"));
			 System.out.println("fdsfds");
			list.add(rs.getString("educationbackground"));
		
			list.add(rs.getString("speciality"));
		
			list.add(rs.getString("graduateuniversity"));
			list.add(rs.getString("phone"));
			list.add(rs.getString("mobile"));
			list.add(rs.getString("name"));
			list.add(rs.getString("id"));
			list.add(rs.getString("age"));
				
			list.add(rs.getString("address"));
			list.add(rs.getString("msn"));
			list.add(rs.getString("qq"));
			list.add(rs.getString("question"));
			list.add(rs.getString("gender"));
			list.add(rs.getString("createtime"));
			
		}
	} catch (Exception e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	} 
	
	return list;
}
}
